FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/library/node:18 as build-stage

WORKDIR /app

COPY package*.json ./
COPY docs ./docs

RUN npm install
RUN npm run docs:build

FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/nginx:stable
COPY nginx.conf /etc/nginx/nginx.conf
COPY --from=build-stage /app/docs/.vuepress/dist /usr/share/nginx/html
EXPOSE 80